package com.atguigu.junit;

import com.atguigu.domain.Employee;
import com.atguigu.service.NameListService;
import com.atguigu.service.TeamException;
import org.junit.Test;

import java.util.stream.Stream;

/**
 * @author : leimingchao
 * @date Date : 2021年09月15日 21:33
 */
public class NameListServiceTest {

    @Test
    public void testGetAllEmployees() {

        NameListService nameListService = new NameListService();

        Stream.of(nameListService.getAllEmployees()).forEach(System.out::println);

    }

    @Test
    public void testGetEmployee() {

        NameListService nameListService = new NameListService();
        try {
            Employee employee = nameListService.getEmployee(101);
            System.out.println(employee);
        } catch (TeamException e) {
            System.out.println(e.getMessage());
        }
    }
}
